#pragma once
#include "SystemPCH.h"

BEGIN_NAME_SPACE
template<class T>
class Vector
{
public:
    class Iterator
    {
        T* ptr_;
    public:
        Iterator():ptr_(null){}
        Iterator(T* ptr):ptr_(ptr){}
        ~Iterator()
        {

        }
    public:
        T& operator* ( void )
        {
            return *ptr_;
        }

        const T& operator* (void) const
        {
            return *ptr_;
        }

        Iterator& operator++(void)
        {
            Iterator* tmp = this;
            return *this;
        }

        const Iterator& operator++(void) const
        {
            ptr_++;
            return *this;
        }

        Iterator operator++(int)
        {
            Iterator tmp = *this;
            ++ptr_;
            return tmp;
        }

        const Iterator operator++(int) const
        {
            Iterator tmp = *this;
            ++ptr_;
            return tmp;
        }

        Iterator& operator--(void)
        {
            --ptr_;
            return *this;
        }

        const Iterator& operator--(void) const 
        {
            --ptr_;
            return *this;
        }

        Iterator operator--(int)
        {
            Iterator tmp = *this;
            --ptr_;
            return tmp;
        }

        const Iterator operator--(int) const 
        {
            Iterator tmp = *this;
            --ptr_;
            return tmp;
        }

        bool operator ==(const Iterator& it) const
        {
            return it.ptr_ == this->ptr;
        }

        bool operator!=(const Iterator& it) const
        {
            return !(*this==it);
        }

    };
// Constructor, Copy Constructor, Destructor
public:
    Vector()
    {
        element_ = new T[100];
        size_ = 0;
        capacity_ = 100;
    }

    Vector( const Vector<T>& other )
    {

    }
    
    ~Vector()
    {
        SAFE_DELETE_ARRAY((element_));
    }

// Common operators
public:
    void PushBack( const T& element )
    {
        element_[size_++] = element; 
    }

    Iterator Begin()
    {
        return Iterator(element_);
    }

    Iterator End()
    {
        return Iterator(element_+size_);
    }

    Iterator Back()
    {
        return Iterator(element_+size_-1);
    }

private:
    T*     element_;
    int    size_;
    int    capacity_;
};

#include "Vector.inl"

END_NAME_SPACE